#! /bin/sh

GW_VERSION_V=$(head -n 1 VERSION)
FUSE_VERSION_V=$(tail -n 1 VERSION)
GW_VERSION=${GW_VERSION_V#"v"}
FUSE_VERSION=${FUSE_VERSION_V#"v"}

echo "Installing gateway(version_$GW_VERSION)..."
dpkg -i surcloud-gateway-$GW_VERSION.deb

echo "Installing hybrid storage(version_$FUSE_VERSION)..."
dpkg -i surcloud-hybrid-storage-$FUSE_VERSION.deb

mkdir -pv /gwserver
cd /gwserver
cp /usr/local/share/dicom/dicom.conf.sample dicom.conf
sed -i "s/107374182400/536870912000/g" dicom.conf
dicom -x
netstat -natp | grep 3322
